<?php

	class Country_model extends CI_Model {

		protected $__tbname = 'country';
		protected $__dbconf = 'default';

		var $id;	//bigint(20) unsigned	Primary Key	Auto Increment	NOT NULL
		var $code;	//varchar(2)	Unique Key		NOT NULL
		var $name;	//varchar(25)			NOT NULL
		var $language;	//varchar(5)			NULL
		var $is_deleted = 0;	//tinyint(1)			NULL
		var $id_region = 0;	//int(11)			NOT NULL

		protected $__validation_rule = array(
			'id' => array('key' => 'PRI', 'type' => 'bigint', 'null' => FALSE, 'auto_increment' => TRUE),
			'code' => array('key' => 'UNI', 'type' => 'varchar', 'size' => 2, 'null' => FALSE),
			'name' => array('type' => 'varchar', 'size' => 25, 'null' => FALSE),
			'language' => array('type' => 'varchar', 'size' => 5, 'null' => TRUE),
			'is_deleted' => array('type' => 'tinyint', 'null' => TRUE),
			'id_region' => array('type' => 'int', 'null' => FALSE)
		);

		protected $__relation = array(
			array('table' => 'region', 'foreign_key' => 'id_region')
		);
	}
